home *** CD-ROM | disk | FTP | other *** search
- /*
- ##########################################################################
- #### ####
- #### The MusicBox Project ####
- #### ============================ ####
- #### ####
- #### MusicBoxPrint.c ####
- #### ####
- #### Version 2.1os -- September 29, 2000 ####
- #### ####
- #### Copyright (C) 1994 Thomas Dreibholz ####
- #### 2000 Molbachweg 7 ####
- #### 51674 Wiehl ####
- #### Germany ####
- #### ####
- #### EMail: Dreibholz@bigfoot.com ####
- #### WWW: http://www.bigfoot.com/~dreibholz ####
- #### ####
- ##########################################################################
- */
- /***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
- /* MusicBox - Druckroutinen */
- #include "MusicBox.h"
-
- extern struct Window *KatalogWnd;
- extern struct Katalog *AuswahlK;
-
- void SetupPrinter()
- {
- struct TagItem tag[5];
- register struct FileHandle *con;
-
- con=Open("CON:10/20/620/150/Music Box/AUTO/WAIT/CLOSE",MODE_NEWFILE);
- if(con!=NULL)
- {
- tag[0].ti_Tag=SYS_Input;
- tag[0].ti_Data=NULL;
- tag[1].ti_Tag=SYS_Output;
- tag[1].ti_Data=con;
- tag[2].ti_Tag=SYS_Asynch;
- tag[2].ti_Data=TRUE;
- tag[3].ti_Tag=SYS_UserShell;
- tag[3].ti_Data=TRUE;
- tag[4].ti_Tag=TAG_DONE;
- SystemTagList("SYS:Prefs/Printer",&tag);
- }
- else
- Error(GS(20,"Unable to open AutoCon-window!"));
- }
-
- void PrintIt(win,cat)
- struct Window *win;
- struct Katalog *cat;
- {
- UBYTE text[100];
- register long i,m,s,f;
- register struct FileHandle *fh;
-
- if(cat!=NULL)
- {
- i=MultiRequest(GS(502,"Print..."),
- GS(503,"Do you want to print the current catalog?"),
- GS(504,"Draft|Letter Quality|Abort"));
- SleepPointer(win);
- if(i!=0)
- {
- fh=Open("PRT:",MODE_NEWFILE);
- if(fh!=NULL)
- {
- if(i==1)
- strcpy(&text,"\x1b0\x1b#1\x1b[1\"z\x1bE\x1b[4m\x1b[1m");
- else
- strcpy(&text,"\x1b0\x1b#1\x1b[2\"z\x1bE\x1b[4m\x1b[1m");
- Write(fh,&text,strlen(&text));
- Write(fh,&cat->CDName,strlen(&cat->CDName));
- sprintf(&text,"\n\n\x1b[24m\x1b[22m");
- Write(fh,&text,strlen(&text));
-
- for(i=0;i<cat->Anzahl;i++)
- {
- m=cat->KE[i].TAdresse/75/60;
- s=(cat->KE[i].TAdresse/75) % 60;
- f=cat->KE[i].TAdresse % 75;
- sprintf(&text,"\x1b[1m%02d\x1b[22m %2ld:%02ld'%02ld %s\n",i+1,m,s,f,&cat->KE[i].Titel);
- Write(fh,&text,strlen(&text));
- }
-
- Close(fh);
- }
- else
- Error(GS(505,"Unable to open PRT:"));
- }
- ClearPointer(win);
- }
- else
- {
- MultiRequest(GS(502,"Print..."),
- GS(506,"Please select a CD before print!"),
- GS(507,"Okay"));
- }
- }
-
-